home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1997 May / PC Plus Super CD Issue 127 (May 1997).iso / handson / delphi / outfile / out1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-02-04  |  610 b   |  37 lines

  1. unit Out1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Button1: TButton;
  12.     procedure Button1Click(Sender: TObject);
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TForm1.Button1Click(Sender: TObject);
  27. var
  28.    OutFile: TextFile;
  29. begin
  30.   AssignFile(OutFile, 'Myfile.txt');
  31.   Rewrite(OutFile);
  32.   Writeln(OutFile, 'This is a line of text');
  33.   CloseFile(OutFile);
  34. end;
  35.  
  36. end.
  37.